
if (%OS%) == (Windows_NT) setlocal

rem for windowsXP 2003
set s_date=%date:~0,4%-%date:~5,2%-%date:~8,2%

rem for window2000
rem set s_date=%date:~0,4%-%date:~5,2%-%date:~8,2%

set s_log=%s_date:~0,7%.log
set s_dmp_dzyhpuser=database\\%s_date%dzyhpuser.dmp
set s_rar=database\\%s_date%dzyhp.rar
set s_user=dzyhpuser
set s_password=password
set s_servername=dzyhp_110

echo ---------------------------------- %s_date% ---------------------------------- >> %s_log%

echo %time%: starting backup database...
echo ----- %time%: starting backup database... ----- >>  %s_log%
if not exist database (md database)

echo %time%: export dzyhpuser's data...
echo ----- %time%: export dzyhpuser's data...      ----- >>  %s_log%
exp %s_user%/%s_password%@%s_servername% owner=dzyhpuser file=%s_dmp_dzyhpuser%

echo %time%: compress dzyhpuser's data files...
echo ----- %time%: compress dzyhpuser's data files...   ----- >>  %s_log%
rar a -r -y -ep1 %s_rar% %s_dmp_dzyhpuser%
del %s_dmp_dzyhpuser%

echo %time%: backup database end!
echo ----- %time%: backup database end!  ----- >>  %s_log%

echo --------------------------------------------------------------------------------- >> %s_log%

if (%OS%) == (Windows_NT) endlocal
exit
@echo on